#ifndef YCCOREATTENTIONMODEL_H
#define YCCOREATTENTIONMODEL_H

#include "attention.h"
#include <QList>
#include <QObject>

namespace yc {

class AttentionModel : public QObject
{
    Q_OBJECT
public:
    explicit AttentionModel(QObject* parent = nullptr);
    ~AttentionModel();

    const QList<Attention*>& attentions() const { return attentions_; }
    Attention* attention(int id) const;
    void add(const Attention& attention);
    void remove(int id);
    void clear();

    Attention* find(int presenter) const;
    int autoCheckCount() const;
    int autoRecordCount() const;
    void setAutoCheck(int id, bool auto_check);
    void setAutoRecord(int id, bool auto_record);
    void setCategory(int id, bool category);

Q_SIGNALS:
    void added(yc::Attention* attention, QPrivateSignal);
    void changed(yc::Attention* attention, QPrivateSignal);
    void removed(yc::Attention* attention, QPrivateSignal);
    void modelAboutToBeReset(QPrivateSignal);
    void modelReset(QPrivateSignal);

private:
    QList<Attention*> attentions_;
};

} // namespace yc

#endif // YCCOREATTENTIONMODEL_H
